package com.example.demo.Controller;

import com.example.demo.Service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class ResumeController {

    @Autowired
    private ResumeService resumeService;
    @GetMapping("/resume/{id}")
    public String getResumePage(@PathVariable("id") Long id,Model model) {
        Long userId = id; // 默认用户
        model.addAttribute("user", resumeService.getUser(userId));
        model.addAttribute("educations", resumeService.getEducations(userId));
        model.addAttribute("workExperiences", resumeService.getWorkExperiences(userId));
        model.addAttribute("campusExperiences", resumeService.getCampusExperiences(userId));
        model.addAttribute("skills", resumeService.getSkills(userId));
        model.addAttribute("evaluation", resumeService.getEvaluation(userId));
        return "resume"; // 对应 resume.html
    }

}
